import { fetch } from '../util/http.js';

/**
 * 获取抽奖列表数据
*/
export function getLuckDrawData(data){
  return fetch({
    url:'activity/search',
    method:'post',
    data:data
  });
}

/**
 * 添加抽奖活动
*/
export function addLuckDraw(data){
  return fetch({
    url:'activity',
    method:'post',
    data:data
  });
}

/**
 * 添加用户openID
*/
export function addOpenIdData(data){
  return fetch({
    url:'activity/bindLotteryUser',
    method:'post',
    data:data
  });
}

/**
 * 搜索抽奖列表数据
*/
export function searchLuckDrawData(data){
  return fetch({
    url:'activity/search',
    method:'post',
    data:data
  });
}

/**
 * 获取活动详细信息
*/
export function getDetails(data){
  return fetch({
    url:'activity/getActivity',
    method:'post',
    data:data
  });
}

/**
 * 获取中奖者收货信息
*/
export function getAddress(data){
  return fetch({
    url:'activity/winner/address',
    method:'post',
    data:data
  });
}

/**
 * 发货
 */
export function deliverGoods(data){
  return fetch({
    url:'sys/affirm/shipments',
    method:'post',
    data:data
  });
}

/**
 * 获取编辑抽奖活动的数据
*/
export function getLuckDrawEditData(data){
  return fetch({
    url:'activity/getActivity',
    method:'post',
    data:data
  });
}

/**
 * 获取开奖指定用户信息
*/
export function getUserOpenId(data){
  return fetch({
    url:'activity/selectByIswon',
    method:'post',
    data:data
  });
}

/**
 * 编辑抽奖活动
*/
export function editLuckDraw(data){
  return fetch({
    url:'auth/activity',
    method:'put',
    data:data
  });
}